package problem.testQuestion;

import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

/*
*   旧键盘试题
* */
public class OldKeyBoard {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        String expStr = scanner.nextLine().toUpperCase();
        String actStr = scanner.nextLine().toUpperCase();

        Set<Character> actSet = new HashSet<>();

        for(int i = 0;i<actStr.length();i++){
            actSet.add(actStr.charAt(i));
        }

        Set<Character> retSet = new HashSet<>();

        for (int i = 0; i < expStr.length(); i++) {
            char c = expStr.charAt(i);

            if(!actSet.contains(c)){
                if(retSet.add(c)){
                    System.out.print(c);
                }
            }
        }
    }
}
